<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title><?=$da['title']?></title>
    <link rel="stylesheet" type="text/css" href="mode/weui/weui.min.css"/>
    <link rel="stylesheet" type="text/css" href="web/res/fontawesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="webmain/css/rui.css">
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/js.js"></script>
    <script type="text/javascript" src="js/jswx.js"></script>
    <script type="text/javascript" src="js/base64-min.js"></script>
    <script type="text/javascript" src="webmain/we/ying/ying.js"></script>
    <script type="text/javascript" src="mode/plugin/jquery-rockdoupull.js"></script>

    <style>
        body,html{background-color:#f1f1f1;overflow:hidden}

        .weui_tab{position:fixed;bottom:0px;width:100%;height:50px}
        .weui_navbar_item{font-size:16px;}
        .weui_navbar_item span{position:absolute;left:3px;top:3px}
        .weui_navbar_item:active{background-color:#f5f5f5}

        .contline{padding-top:10px;color:#999999;font-size:14px;text-align:center;}
        .contlist{margin:15px;padding:8px 10px;position:relative; background:white}
        .contlist:active,.active{ background-color:#f1f1f1}
        .contlist .title{font-size:16px}
        .contlist .dt{font-size:12px;color:#aaaaaa;}
        .contlist .xq{color:#3D8EDB;font-size:14px;padding-top:7px}
        .contlist .xq span{float:right}
        .contlist .cont{font-size:14px;padding:10px 0px}
        .contlist .imgs{height:130px;overflow:hidden;margin:5px 0px}
        .contlist .zt{font-size:10px;position:absolute;top:1px;right:0px;padding:1px 3px;background-color:red;color:white}
        .contlist .face{font-size:14px;padding:5px 0px;height:30px;overflow:hidden;}
        .contlist .face img{border-radius:15px;height:24px;width:24px;margin-right:5px}
        .contlist .opt{font-size:10px;position:absolute;bottom:1px;right:1px;padding:1px 3px;color:#aaaaaa}

        .showblank{color:#aaaaaa;font-size:14px;padding-bottom:15px;text-align:center}
        .showblanks{padding:10px;color:#aaaaaa;font-size:12px;text-align:center}
        .notrecord{text-align:center;font-size:20px;padding-top:50px;color:#aaaaaa}

        body,html{
            height: 100%;
            background-color: white;
        }

        ul li{border-bottom: 1px grey solid ; padding-bottom: 10px}

        .div1{display: flex; flex-direction: column}

        .div2{display: flex; flex-direction: row;margin: 0px 10px}

        img{width: 30px; height: 30px ; border-radius: 15px}

        .span1{margin-left: 20px; display: inline-block;height: 30px;line-height: 30px}


    </style>
    <script>

        var mid = GetQueryStrings("mid");

        var clickedit = 0;

        var json = <?=json_encode($dailyArr)?>;

        var json1 = <?=json_encode($commentArr)?>;

        var json2 = <?=json_encode($xxdataArr)?>;

        var json3 = <?=json_encode($lowidArr)?>;

        var json4 = <?=json_encode($lowdailyArr)?>;

        var json5 = <?=json_encode($adminArr)?>;

        var json6 = <?=json_encode($checkArr)?>;

        window.onload=function(){

            loadDetail();




        }

        function loadDetail(){



            var type = GetQueryStrings("type");

            if (type == 0) {
                JSON = json;
            }else{

                JSON = json4;
                document.getElementById("edit").style.visibility="hidden"
            }
            var checkhtml = '';
            var num = 0;
            for(var i = 0; i < json6.length;i++){

                var obj = json6[i];

                if(obj.mid == mid){

                    checkhtml += '<span style="margin-right: 5px">'+ obj.checkname +'</span>'
                    num++;
                }
            }

            $('#check').html(checkhtml);

            $('#num').html(''+ num +'人');

            for(var i = 0; i < JSON.length;i++){

                var j = JSON[i];

                if(j.id == mid){


                    $('#content').html(j.content);
                    $('#time').html(j.dt +'&nbsp&nbsp&nbsp 日报' );


                    if(getdays(j.dt) >1){
                        document.getElementById("edit").style.visibility="hidden"
                    }

                }
            }

            var html ='';


            for (var i = 0; i < json1.length;i++){

                var j = json1[i];

                if(j.mid == mid){

                    if(facecontain(j.checkid)){
                        var url = facecontain(j.checkid);

                        html += '<li><div class="div1"><div class="div2"><img src='+ url +'><span class="span1">'+ j.checkname +'</span></div><span  style="margin: 20px 10px">'+ j.explain +'</span><span style="margin: 0px 10px">'+j.optdt +'</span></div></li>'
                    } else{

                        html += '<li><div class="div1"><div class="div2"><img src="http://i18.anhuiqq.cn/uploads/i_4_2246533969x3386744293_21.jpg"><span class="span1">'+ j.checkname +'</span></div><span  style="margin: 20px 10px">'+ j.explain +'</span><span style="margin: 0px 10px">'+j.optdt +'</span></div></li>'
                    }



                }

            }


            $('#ul').html(html);
        }


        function getdays(sincetime){

            var d = new Date;

            var day=d.getDate()

            var month=d.getMonth() + 1

            var year=d.getFullYear()

            var timecurrent = year + "-" + month + "-" + day;

            var tmp = timecurrent.split("-");

            var T1 = new Date(tmp[0],tmp[1]-1,tmp[2]);

            tmp = sincetime.split("-");

            var T2 = new Date(tmp[0],tmp[1]-1,tmp[2]);


            return (T1.getTime() - T2.getTime())/60/60/24/1000


        }




        function facecontain(checkid){


            for(var m=0;m<json5.length;m++){
                var obj = json5[m];
                if(obj.id == checkid){

                    if(obj.face == '[Null]'){
                        return false;
                    } return obj.face;

                }
            }

        }



        function comment() {

            var url='index.php?a=comment&m=ying&d=we&num=daily&show=we&mid='+ mid +'';


            js.location(url);

        }

        function GetQueryStrings(name)
        {
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        }



        function myFunction() {


            $.ajax({

                type: 'POST',
                url: "http://oa.wxlion.com/index.php?a=detail&m=ying&d=we&num=daily&show=we",
                 //url: "http://localhost/oa/public_html/index.php?a=detail&m=ying&d=we&num=daily&show=we",

                data: {

                    clickedit : clickedit
                },
                datatype: "json",
                success: function(result) {

                    var arr = eval(result);

                    if (clickedit == 1){
                        json = arr;
                    }else{ json1 = arr;}

                    loadDetail();


                },
                //调用出错执行的函数
                error: function(error1) {


                }
            });

        }

        function edit(){

            var url='index.php?a=write&m=ying&d=we&num=daily&show=we&edit=1&mid='+ mid +'';

            clickedit =1;

            js.location(url);
        }


    </script>
</head>

<body onpageshow="myFunction()">

        <div  style="width: 100%; height: calc(100% - 60px);  overflow: auto; background-color: white;">

            <div style="display: flex;flex-direction: row;justify-content: space-between;">


                <div id="time" style="margin: 10px 10px 0px 10px"></div>

                <div onclick="edit()" id="edit" style="margin: 10px 10px 0px 10px; visibility:visible" >编辑</div>

            </div>



            <pre id="content" style="border-bottom: 5px rgba(239,239,239,1) solid ;padding: 30px 10px;font-size: 15px"></pre>

            <div style="display: flex; flex-direction: row; margin: 10px">

                <div style="margin-right: 10px" >查看记录</div>

                <span id="num"></span>

            </div>


            <div id="check" style="padding: 10px;border-bottom: 5px rgba(239,239,239,1) solid ;">


            </div>

            <ul id="ul">


            </ul>


            </div>


        <div  onclick="comment()" style="text-align: center; width: 90%; border-radius: 5px; height: 30px;line-height: 30px; margin: 10px 5% 10px 5%; padding: 5px 0px;  background-color: rgb(27,205,138); font-size: 16px">写评论<div>

</body>




<?php
if($yyurljs!='')echo '<script type="text/javascript" src="'.$yyurljs.'"></script>'."\n";
        ?>
<script type="text/javascript" src="web/res/js/jquery-imgview.js"></script>
<script type="text/javascript" src="web/res/js/jquery-rockupload.js"></script>
<script type="text/javascript" src="web/res/js/jquery-changeuser.js"></script>
</>
</html>